package net.xdclass.websocket.controller.v1;

import net.xdclass.websocket.model.InMessage;
import net.xdclass.websocket.model.OutMessage;
import net.xdclass.websocket.service.WebSocketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

/**
 * @description: 游戏公告控制器
 * @author: Yz
 * @create: 2020-06-30 14:03
 **/
@Controller
public class GameInfoController {



    /**
     * 发送消息
     * @param message
     * @return
     */
    @MessageMapping("v1/chat")
    @SendTo("/topic/game_chat")
    public OutMessage gameInfo(InMessage message){

        return new OutMessage(message.getContent());

    }
}
